NCTAudioCompress2Lib

NCTAudioStudio2 ActiveX DLLs
NCTAudioCompress2 ActiveX DLL

Version 2.2

NCTAudioCompress2 ActiveX DLL is a tool for compressing and decompressing of audio data in memory for its further transmitting via the Internet or Intranet. It can be used together with other NCTAudioStudio2 controls for recording, compressing, decompressing and playing. You can get audio data from any sources. For example it may be microphone, Internet or an audio file opened by NCTAudioFile2 ActiveX DLL. You can use NCTAudioCompress2 to create your own, unique audio formats based on well-known compression algorithms.

NCTAudioCompress2 consists of the following objects:

  • AudioCompress2 - the main object for compression and decompression.

  • AudioCompress2LameEnc - a complementary object for changing parameters of lame mp3 encoder.

The following audio formats are supported:

  • ACM

  • WAV PCM;

  • Compressed WAV (GSM, ADPCM, DSP, ALAW, ULAW, and others);

  • MP2;

  • MP3 (including files with VBR (variable bitrate));

  • WMA;

  • VOX;

  • RAW (PCM);

  • G.721, G.723, G.726;

  • Mobile Voice;

  • Ogg Vorbis.

NCTAudioCompress2 is a part of the NCTAudioStudio2 package.

Send Feedback on the NCTAudioCompress2 documentation.
NCTAudioCompress2 was developed by NCT Company Ltd. http://www.nctsoft.com


NCTAudioCompress2 objects

NCTAudioCompress2 objects

Object | Description
AudioCompress2 | The AudioCompress2 object is intended for compressing and decompressing of audio data.
AudioCompress2LameEnc | The AudioCompress2LameEnc object is intended for changing the parameters of the lame mp3 encoder.


AudioCompress2

AudioCompress2 object

The AudioCompress2 object is intended for compressing and decompressing of audio data.


AudioCompress2 properties

AudioCompress2 properties

Property | Type | Default | Description
ArrayChannels | ChannelsConstants |  | Read-only property that returns the number of channels of the audio array, set by the SetFormatArray method.
ArrayFrequency | FrequencyConstants |  | Read-only property that returns the frequency of the audio array, set by the SetFormatArray method.
CurrentDecoderFormat | FormatTypeConstants |  | Read-only property that returns the type of the current decoder format.
CurrentEncoderFormat | FormatTypeConstants |  | Read-only property that returns the type of the current encoder format.
LastErrorNum | ErrorConstants |  | Read-only property that returns the value indicating the last error.


ArrayChannels property (AudioCompress2)

ArrayChannels property (AudioCompress2 object)

Read-only property that returns the number of channels of the audio array, set by the SetFormatArray method. Mono data uses one channel and stereo data uses two channels.

Property type

A ChannelsConstants value.

Syntax

[value = ]object.ArrayChannels

The ArrayChannels property syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
value | ChannelsConstants | Number of channels.

Remarks:

The SetFormatArray method is to be used to define sample rate and the number of channels of uncompressed audio data array.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim nChannels As ChannelsConstants
nChannels = Compress.ArrayChannels

See Also:

ArrayFrequency

Applies to: AudioCompress2


ArrayFrequency property (AudioCompress2)

ArrayFrequency property (AudioCompress2 object)

Read-only property that returns the frequency of the audio array, set by the SetFormatArray method.

Property type

A FrequencyConstants value.

Syntax

[value = ]object.ArrayFrequency

The ArrayFrequency property syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
value | FrequencyConstants | The frequency of the audio array.

Remarks:

The SetFormatArray method is to be used to define sample rate and number of the channels of uncompressed audio data array.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim Frequency As FrequencyConstants
Frequency = Compress.ArrayFrequency

See Also:

ArrayChannels

Applies to: AudioCompress2


CurrentDecoderFormat property (AudioCompress2)

CurrentDecoderFormat property (AudioCompress2 object)

Read-only property that returns the type of the current decoder format.

Property type

A FormatTypeConstants value.

Syntax

[value = ]object.CurrentDecoderFormat

The CurrentDecoderFormat property syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
value | FormatTypeConstants | Type of the format.

Remarks:

Set by InitDecoder method.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim Format As String
If TypeComp = 1 Then
Compress.SetFormatPCM Freq, Chann, BPS_16_BIT
Compress.InitDecoder WAV
ElseIf TypeComp = 2 Then
Compress.InitDecoder MP3
ElseIf TypeComp = 3 Then
Compress.InitDecoder MP2
ElseIf TypeComp = 4 Then
Compress.SetFormatVOX Freq
Compress.InitDecoder VOX
ElseIf TypeComp = 5 Then
Compress.SetFormatG721 Freq
Compress.InitDecoder G721
ElseIf TypeComp = 6 Then
Compress.SetFormatG723 Freq, BitsPerSample
Compress.InitDecoder G723
ElseIf TypeComp = 7 Then
Compress.SetFormatG726 Freq, BitsPerSample
Compress.InitDecoder G726
End If
Format = CurrentDecoderFormat

See Also:

CurrentEncoderFormat

Applies to: AudioCompress2


CurrentEncoderFormat property (AudioCompress2)

CurrentEncoderFormat property (AudioCompress2 object)

Read-only property that returns the type of the current encoder format.

Property type

A FormatTypeConstants value.

Syntax

[value = ]object.CurrentEncoderFormat

The CurrentEncoderFormat property syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
value | FormatTypeConstants | Type of the format.

Remarks:

Set by InitEncoder method.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim Format As String
If cmbTypeCompress.ListIndex = 0 Then 'PCM
Compress.InitEncoder WAV
ElseIf cmbTypeCompress.ListIndex = 1 Then 'MP3
Compress.InitEncoder MP3
ElseIf cmbTypeCompress.ListIndex = 2 Then 'MP2
Compress.InitEncoder MP2
ElseIf cmbTypeCompress.ListIndex = 3 Then 'VOX
Compress.InitEncoder VOX
ElseIf cmbTypeCompress.ListIndex = 4 Then 'G.721
Compress.InitEncoder G721
ElseIf cmbTypeCompress.ListIndex = 5 Then 'G.723
Compress.InitEncoder G723
ElseIf cmbTypeCompress.ListIndex = 6 Then 'G.726
Compress.InitEncoder G726
End If
Format = CurrentEncoderFormat

See Also:

CurrentDecoderFormat

Applies to: AudioCompress2


LastErrorNum property (AudioCompress2)

LastErrorNum property (AudioCompress2 object)

Read-only property that returns the value indicating the last error.

Property type

An ErrorConstants value.

Syntax

object.LastErrorNum [= value]

The LastErrorNum property syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
value | ErrorConstants | Error code.

 Remarks:

At present you can use two ways for an errors catch: using the standard error processor from VB or using the LastErrorNum property.

See Also:

Applies to: AudioCompress2

Send Feedback on the NCTAudioCompress2 documentation.
NCTAudioCompress2 was developed by NCT company http://www.nctsoft.com


AudioCompress2 methods

AudioCompress2 methods

Method | Description
DecodeArray | Decodes compression audio data array.
EncodeArray | Encodes audio data array.
InitDecoder | Initializes the type of decoder.
InitEncoder | Initializes the type of encoder.
IsFormatMpegAvailable | Indicates if the parameters are supported by Mpeg codec or not.
IsFormatOggVorbisAvailable | Indicates if the parameters are supported by Ogg Vorbis codec or not.
Register | Enters user name and registration password to disable About window.
SetFormatACM | Sets the format of an ACM audio file.
SetFormatACM_cbArray | Sets the array of the extra information in the format header.
SetFormatADPCM | Sets the format of an ADPCM audio file.
SetFormatALAW | Sets the format of an A-law audio file.
SetFormatArray | Sets the format of audio data. Audio data is an Integer array in the PCM format.
SetFormatDSP | Sets the format of a DSP Group TrueSpeech (TM) audio file.
SetFormatG721 | Sets the format of a G.721 audio file.
SetFormatG723 | Sets the format of a G.723 audio file.
SetFormatG726 | Sets the format of a G.726 audio file.
SetFormatGSM | Sets the format of an GSM audio file.
SetFormatMP3 | Sets the format of a Mobile Voice audio file.
SetFormatMP2 | Sets the format of an MP2 audio file.
SetFormatMP3Ex | Sets the format of an MP3 audio file.
SetFormatOggVorbis | Sets the format of an Ogg Vorbis audio file.
SetFormatPCM | Sets the format of a PCM audio file.
SetFormatULAW | Sets the format of an U-law audio file.
SetFormatVOX | Sets the format of a VOX audio file.


DecodeArray method

DecodeArray method (AudioCompress2 object)

Decodes arrays of compressed audio data.

Return Type

An Integer() value.

Syntax

DecodeArray = object.DecodeArray(CompressArray As BYTE())

The DecodeArray method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
CompressArray | BYTE() | The compressed array.
DecodeArray | Integer() | An array of uncompressed audio data.

Remarks:

Format of arrays of uncompressed audio data have to be defined by the SetFormatArray method and format of arrays of compressed audio data have to be defined by the SetFormatXXX and InitDecoder methods.

Example:

' VB sample where Compress is an AudioCompress2 object.
ArrPCM() = Compress.DecodeArray(ArrCompress())

See Also:

EncodeArray

Applies to: AudioCompress2


EncodeArray method

EncodeArray method (AudioCompress2 object)

Encodes audio data arrays. Receives arrays of uncompressed audio data and returns arrays of compressed audio data.

Return Type

A BYTE() value.

Syntax

EncodeArray = object.EncodeArray(PCMArray As Integer())

The EncodeArray method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
PCMArray | Integer() | The array of uncompressed audio data.
EncodeArray | BYTE() | The compressed array.

Remarks:

Format of arrays of uncompressed audio data have to be defined by the SetFormatArray method and format of arrays of compressed audio data have to be defined by the SetFormatXXX and InitEncoder methods.

Example:

' VB sample where Compress is an AudioCompress2 object.
ArrCompress() = Compress.EncodeArray(ArrPCM())

See Also:

DecodeArray

Applies to: AudioCompress2


InitDecoder method

InitDecoder method (AudioCompress2 object)

Initializes the type of decoder.

Return Type

A Long value.

Syntax

BlockAlign = object.InitDecoder(type As FormatTypeConstants)

The InitDecoder method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
type | FormatTypeConstants | The type of format.
BlockAlign | Long | The block alignment of the data, in bytes. This is a minimum size of data block for converting.

Remarks:

Initializes decoding algorithm. This method has only one parameter. This type of compression algorithm will be used: WAV, MP2, MP3 and etc.

In this method you have to use the same type of the parameter as in the SetFormatXXX methods.
For example if you use SetFormatMP2 method you have to set the MP2 parameter in the InitEncoder or InitDecoder methods.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatPCM Freq, Chann, BPS_16_BIT
Compress.InitDecoder WAV
ElseIf TypeComp = 2 Then
Compress.InitDecoder MP3
ElseIf TypeComp = 3 Then
Compress.InitDecoder MP2
ElseIf TypeComp = 4 Then
Compress.SetFormatVOX Freq
Compress.InitDecoder VOX
ElseIf TypeComp = 5 Then
Compress.SetFormatG721 Freq
Compress.InitDecoder G721
ElseIf TypeComp = 6 Then
Compress.SetFormatG723 Freq, BitsPerSample
Compress.InitDecoder G723
ElseIf TypeComp = 7 Then
Compress.SetFormatG726 Freq, BitsPerSample
Compress.InitDecoder G726
End If

See Also:

InitEncoder

Applies to: AudioCompress2


InitEncoder method

InitEncoder method (AudioCompress2 object)

Initializes the type of encoder.

Return Type

A Long value.

Syntax

BlockAlign = object.InitEncoder(type As FormatTypeConstants)

The InitEncoder method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
type | FormatTypeConstants | The type of format.
BlockAlign | Long | The block alignment of the data, in bytes. This is a minimum size of data block for converting.

Remarks:

Initializes encoding algorithm. This method has only one parameter. This type of compression algorithm will be used: WAV, MP2, MP3 and etc.

In this method you have to use the same type of the parameter as in the SetFormatXXX methods.
For example if you use SetFormatMP2 method you have to set the MP2 parameter in the InitEncoder or InitDecoder methods.

Example:

' VB sample where Compress is an AudioCompress2 object.
If Index = 0 Then 'PCM
Compress.InitEncoder WAV
ElseIf Index = 1 Then 'MP3
Compress.InitEncoder MP3
ElseIf Index = 2 Then 'MP2
Compress.InitEncoder MP2
ElseIf Index = 3 Then 'VOX
Compress.InitEncoder VOX
ElseIf Index = 4 Then 'G.721
Compress.InitEncoder G721
ElseIf Index = 5 Then 'G.723
Compress.InitEncoder G723
ElseIf Index = 6 Then 'G.726
Compress.InitEncoder G726
End If

See Also:

InitDecoder

Applies to: AudioCompress2


IsFormatMpegAvailable method

IsFormatMpegAvailable method (AudioCompress2 object)

Indicates if the parameters are supported by Mpeg codec or not.

Return Type

A Boolean value.

Syntax

MpegFormat = object.IsFormatMpegAvailable(Frequency As FrequencyConstants, Bitrate As BitrateConstants, Channels As ChannelsConstants)

The IsFormatMpegAvailable method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of a Mpeg file. By default the Frequency is equal to FQ_44_KHZ.
Bitrate | BitrateConstants | Bitrate of a Mpeg file. By default the Bitrate is set to BR_128_KBPS.
Channels | ChannelsConstants | The number of channels of a Mpeg file.
MpegFormat | Boolean | True if Mpeg parameters have correct values, otherwise - False.

Remarks:

This method is recommended to use before applying SetFormatMP2 or SetFormatMP3Ex methods.

See Also:

SetFormatMP2 | SetFormatMP3Ex

Applies to: AudioCompress2


IsFormatOggVorbisAvailable method

IsFormatOggVorbisAvailable method (AudioCompress2 object)

Indicates if the parameters are supported by Ogg Vorbis codec or not.

Return Type

A Boolean value.

Syntax

OggVorbis Format = object.IsAvailableFormatOggVorbis(Frequency As FrequencyConstants, nChannels As ChannelsConstants, NominalBitrate As BitrateConstants, MinBitrate As BitrateConstants, MaxBitrate As BitrateConstants)

The IsFormatOggVorbisAvailable method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of the audio file. By default the Frequency is equal to FQ_44_KHZ.
nChannels | ChannelsConstants | The number of channels of the audio file. By default the nChannels is equal to STEREO.
NominalBitrate | BitrateConstants | Bitrate of the audio file. By default the NominalBitrate is equal to BR_128_KBPS.
MinBitrate | BitrateConstants | Minimal bitrate. By default the MinBitrate is equal to BR_NONE.
MaxBitrate | BitrateConstants | Maxilmal bitrate. By default the MaxBitrate is equal to BR_NONE.
OggVorbis Format | Boolean | True if Ogg Vorbis parameters have correct values, otherwise - False.

Remarks:

This method is recommended to use before applying SetFormatOggVorbis method.

See Also:

SetFormatOggVorbis

Applies to: AudioCompress2


Register method

Register method (AudioCompress2 object)

Enters user name and registration password to disable About window.

Syntax

object.Register(strUser As String, strPassword As String)

The Register method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
strUser | String | The user name. You get the registration user name after the registration.
strPassword | String | The password string. You get the registration password after the registration.

Example:

' VB sample where Compress is an AudioCompress2 object.
Compress.Register "XXX", "XXX"

See Also:

Applies to: AudioCompress2


SetFormatACM method

SetFormatACM method (AudioCompress2 object)

Sets the format of an ACM audio compression.

Syntax

object.SetFormatACM(Format As ACMFormat)

The SetFormatACM method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Format | ACMFormat | Structure for ACM format parameters.

Remarks:

Before applying the SetFormatACM method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim ACM As ACMFormat
ACM.wFormatTag = 1 'PCM format
ACM.wBitsPerSample = 8
ACM.nSamplesPerSec = 44,100
ACM.nChannels = 2
ACM.nBlockAlign = (ACM.nChannels*ACM.wBitsPerSample)/8 'Only for PCM format
ACM.nAvgBytesPerSec = ACM.nBlockAlign*ACM.nSamplesPerSec 'Only for PCM format
ACM.cbSize = 0 'for PCM format extra information is not used
Compress.SetFormatACM ACM

See Also:

SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatACM_cbArray method

NCTAudioCompress ActiveX DLL
SetFormatACM_cbArray method (AudioCompress2 object)

Sets the array of the extra information in the format header.

Syntax

object.SetFormatACM_cbArray(cbArray As Byte())

The SetFormatACM_cbArray method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
cbArray | Byte() | The array of the extra information.

Remarks:

Before applying the SetFormatACM_cbArray method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim ACM As ACMFormat
Dim cb() As Byte
...'Filling of array of the extra information

ACM.wFormatTag = 2 'ADPCM format
ACM.wBitsPerSample = 4
ACM.nSamplesPerSec = 44,100
ACM.nChannels = 2
ACM.nBlockAlign = 2048 'Only for ADPCM format
ACM.nAvgBytesPerSec = 44359 'Only for ADPCM format
ACM.cbSize = 32 'for ADPCM format extra information

cb()=Array(32,7,7,0,0,1,0,0,0,2,0,255,0,0,0,0,192,0,64,0,240,0,0,0,204,1,48,255,136,1,24,255)

Compress.SetFormatACM ACM
Compress.SetFormatACM_cbArray cb()

See Also:

SetFormatACM | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2

Send Feedback on the NCTAudioCompress documentation.
NCTAudioCompress was developed by NCT company http://www.nctsoft.com


SetFormatADPCM method

SetFormatADPCM method (AudioCompress2 object)

Sets the format of an ADPCM audio compression.

Syntax

object.SetFormatADPCM(Frequency As FrequencyConstants, nChannels As ChannelsConstants)

The SetFormatADPCM method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an audio file. By default the Frequency is equal to FQ_44_KHZ.
nChannels | ChannelsConstants | Number of channels of an audio file. By default the nChannels is equal to STEREO.

Remarks:

Before applying the SetFormatADPCM method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatADPCM Freq, Chann
ElseIf TypeComp = 2 Then
Compress.SetFormatALAW Freq, Chann
ElseIf TypeComp = 3 Then
Compress.SetFormatDSP
ElseIf TypeComp = 4 Then
Compress.SetFormatGSM Freq
ElseIf TypeComp = 5 Then
Compress.SetFormatMP3 Freq
ElseIf TypeComp = 6 Then
Compress.SetFormatULAW Freq, Chann
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatALAW method

SetFormatALAW method (AudioCompress2 object)

Sets the format of an A-law audio compression.

Syntax

object.SetFormatALAW(Frequency As FrequencyConstants, nChannels As ChannelsConstants)

The SetFormatALAW method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an audio file. By default the Frequency is equal to FQ_8_KHZ.
nChannels | ChannelsConstants | Number of channels of an audio file. By default the nChannels is equal to MONO.

Remarks:

Before applying the SetFormatALAW method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatADPCM Freq, Chann
ElseIf TypeComp = 2 Then
Compress.SetFormatALAW Freq, Chann
ElseIf TypeComp = 3 Then
Compress.SetFormatDSP
ElseIf TypeComp = 4 Then
Compress.SetFormatGSM Freq
ElseIf TypeComp = 5 Then
Compress.SetFormatMP3 Freq
ElseIf TypeComp = 6 Then
Compress.SetFormatULAW Freq, Chann
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatArray method

SetFormatArray method (AudioCompress2 object)

Sets the format of uncompressed audio data. Audio data is an Integer array in the PCM format.

Syntax

object.SetFormatArray(Frequency As FrequencyConstants, Channels As ChannelsConstants)

The SetFormatArray method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an audio file. By default the Frequency is equal to FQ_44_KHZ.
Channels | ChannelsConstants | Number of channels of an audio file. By default the nChannels is equal to STEREO.

Remarks:

Before applying one of the SetFormatXXX methods the SetFormatArray method must be used. It determines compression frequency and the number of channels in the input uncompressed array.

Example:

' VB sample where Compress is an AudioCompress2 object.
Compress.SetFormatArray FQ_44_KHZ, STEREO

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatDSP method

SetFormatDSP method (AudioCompress2 object)

Sets the format of a DSP Group TrueSpeech (TM) audio compression.

Syntax

object.SetFormatDSP()

The SetFormatDSP method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.

Remarks:

Before applying the SetFormatDSP method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatADPCM Freq, Chann
ElseIf TypeComp = 2 Then
Compress.SetFormatALAW Freq, Chann
ElseIf TypeComp = 3 Then
Compress.SetFormatDSP
ElseIf TypeComp = 4 Then
Compress.SetFormatGSM Freq
ElseIf TypeComp = 5 Then
Compress.SetFormatMP3 Freq
ElseIf TypeComp = 6 Then
Compress.SetFormatULAW Freq, Chann
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatG721 method

SetFormatG721 method (AudioCompress2 object)

Sets the format of a G.721 audio compression.

Syntax

object.SetFormatG721(Frequency As FrequencyConstants)

The SetFormatG721 method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of a G.721 audio file. By default the frequency is equal to FQ_8_KHZ.

Remarks:

Before applying the SetFormatG721 method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatPCM Freq, Chann, BPS_16_BIT
Compress.InitDecoder WAV
ElseIf TypeComp = 2 Then
Compress.InitDecoder MP3
ElseIf TypeComp = 3 Then
Compress.InitDecoder MP2
ElseIf TypeComp = 4 Then
Compress.SetFormatVOX Freq
Compress.InitDecoder VOX
ElseIf TypeComp = 5 Then
Compress.SetFormatG721 Freq
Compress.InitDecoder G721
ElseIf TypeComp = 6 Then
Compress.SetFormatG723 Freq, BitsPerSample
Compress.InitDecoder G723
ElseIf TypeComp = 7 Then
Compress.SetFormatG726 Freq, BitsPerSample
Compress.InitDecoder G726
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatG723 method

SetFormatG723 method (AudioCompress2 object)

Sets the format of a G.723 audio compression.

Syntax

object.SetFormatG723(Frequency As FrequencyConstants, BitsPerSample As BitsPerSampleConstants)

The SetFormatG723 method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of a G.723 audio file. By default the frequency is equal to FQ_8_KHZ.
BitsPerSample | BitsPerSampleConstants | Number of bits per sample of an audio file. By default the BitsPerSample is equal to BPS_3_BIT. Can accept BPS_3_BIT and BPS_5_BIT values.

Remarks:

Before applying the SetFormatG723 method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatPCM Freq, Chann, BPS_16_BIT
Compress.InitDecoder WAV
ElseIf TypeComp = 2 Then
Compress.InitDecoder MP3
ElseIf TypeComp = 3 Then
Compress.InitDecoder MP2
ElseIf TypeComp = 4 Then
Compress.SetFormatVOX Freq
Compress.InitDecoder VOX
ElseIf TypeComp = 5 Then
Compress.SetFormatG721 Freq
Compress.InitDecoder G721
ElseIf TypeComp = 6 Then
Compress.SetFormatG723 Freq, BitsPerSample
Compress.InitDecoder G723
ElseIf TypeComp = 7 Then
Compress.SetFormatG726 Freq, BitsPerSample
Compress.InitDecoder G726
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatG726 method

SetFormatG726 method (AudioCompress2 object)

Sets the format of a G.726 audio compression.

Syntax

object.SetFormatG726(Frequency As FrequencyConstants, BitsPerSample As BitsPerSampleConstants)

The SetFormatG726 method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of a G.726 audio file. By default the frequency is equal to FQ_8_KHZ.
BitsPerSample | BitsPerSampleConstants | Number of bits per sample of an audio file. By default the BitsPerSample is equal to BPS_4_BIT. Can accept BPS_2_BIT, BPS_3_BIT, BPS_4_BIT and BPS_5_BIT values.

Remarks:

Before applying the SetFormatG726 method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatPCM Freq, Chann, BPS_16_BIT
Compress.InitDecoder WAV
ElseIf TypeComp = 2 Then
Compress.InitDecoder MP3
ElseIf TypeComp = 3 Then
Compress.InitDecoder MP2
ElseIf TypeComp = 4 Then
Compress.SetFormatVOX Freq
Compress.InitDecoder VOX
ElseIf TypeComp = 5 Then
Compress.SetFormatG721 Freq
Compress.InitDecoder G721
ElseIf TypeComp = 6 Then
Compress.SetFormatG723 Freq, BitsPerSample
Compress.InitDecoder G723
ElseIf TypeComp = 7 Then
Compress.SetFormatG726 Freq, BitsPerSample
Compress.InitDecoder G726
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatGSM method

SetFormatGSM method (AudioCompress2 object)

Sets the format of an GSM audio compression.

Syntax

object.SetFormatGSM(Frequency As FrequencyConstants)

The SetFormatGSM method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of a GSM audio file. By default the frequency is equal to FQ_8_KHZ.

Remarks:

Before applying the SetFormatGSM method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatADPCM Freq, Chann
ElseIf TypeComp = 2 Then
Compress.SetFormatALAW Freq, Chann
ElseIf TypeComp = 3 Then
Compress.SetFormatDSP
ElseIf TypeComp = 4 Then
Compress.SetFormatGSM Freq
ElseIf TypeComp = 5 Then
Compress.SetFormatMP3 Freq
ElseIf TypeComp = 6 Then
Compress.SetFormatULAW Freq, Chann
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatMP2 method

SetFormatMP2 method (AudioCompress2 object)

Sets the format of an MP2 audio compression.

Syntax

object.SetFormatMP2(Frequency As FrequencyConstants, Bitrate As BitrateConstants, nChannels As ChannelsConstants)

The SetFormatMP3 method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an MP2 file. By default the Frequency is equal to FQ_44_KHZ.
Bitrate | BitrateConstants | Bitrate of an MP2 file. By default the Bitrate is set to BR_128_KBPS.
nChannels | ChannelsConstants | The number of channels of an MP2 file. By default nChannels is equal to STEREO.

Remarks:

Before applying the SetFormatMP2 method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If cmbTypeCompress.ListIndex = 0 Then 'PCM
Compress.SetFormatPCM Frequency, Channels, BPS_16_BIT
ElseIf cmbTypeCompress.ListIndex = 1 Then 'MP3
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
Compress.SetFormatMP3Ex LameFormat
ElseIf cmbTypeCompress.ListIndex = 2 Then 'MP2
Compress.SetFormatMP2 Frequency, Bitrate, Channels
ElseIf cmbTypeCompress.ListIndex = 3 Then 'VOX
Compress.SetFormatVOX Frequency
ElseIf cmbTypeCompress.ListIndex = 4 Then 'G.721
Compress.SetFormatG721 Frequency
ElseIf cmbTypeCompress.ListIndex = 5 Then 'G.723
Compress.SetFormatG723 Frequency, BitsPerSample
ElseIf cmbTypeCompress.ListIndex = 6 Then 'G.726
Compress.SetFormatG726 Frequency, BitsPerSample
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatMP3 method

SetFormatMP3 method (AudioCompress2 object)

Sets the format of a MP3 audio compression.

Syntax

object.SetFormatMP3(Frequency As FrequencyConstants, Bitrate As BitrateConstants, nChannels As ChannelsConstants)

The SetFormatMP3 method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an MP3 file. By default the Frequency is equal to FQ_44_KHZ.
Bitrate | BitrateConstants | Bitrate of an MP3 file. By default the Bitrate is set to BR_128_KBPS.
nChannels | ChannelsConstants | The number of channels of an MP3 file. By default nChannels is equal to STEREO.

Remarks:

Before applying the SetFormatMP3 method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatADPCM Freq, Chann
ElseIf TypeComp = 2 Then
Compress.SetFormatALAW Freq, Chann
ElseIf TypeComp = 3 Then
Compress.SetFormatDSP
ElseIf TypeComp = 4 Then
Compress.SetFormatGSM Freq
ElseIf TypeComp = 5 Then
Compress.SetFormatMP3 Freq
ElseIf TypeComp = 6 Then
Compress.SetFormatULAW Freq, Chann
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP2 | SetFormatMP3Ex | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatMP3Ex method

SetFormatMP3Ex method (AudioCompress2 object)

Sets the format of an MP3 audio file.

Syntax

object.SetFormatMP3Ex(LameFormat As AudioCompress2LameEnc)

The SetFormatMP3Ex method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
LameFormat | AudioCompress2LameEnc | An expression evaluating to an object.

Remarks:

Before applying the SetFormatMP3Ex method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If cmbTypeCompress.ListIndex = 0 Then 'PCM
Compress.SetFormatPCM Frequency, Channels, BPS_16_BIT
ElseIf cmbTypeCompress.ListIndex = 1 Then 'MP3
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
Compress.SetFormatMP3Ex LameFormat
ElseIf cmbTypeCompress.ListIndex = 2 Then 'MP2
Compress.SetFormatMP2 Frequency, Bitrate, Channels
ElseIf cmbTypeCompress.ListIndex = 3 Then 'VOX
Compress.SetFormatVOX Frequency
ElseIf cmbTypeCompress.ListIndex = 4 Then 'G.721
Compress.SetFormatG721 Frequency
ElseIf cmbTypeCompress.ListIndex = 5 Then 'G.723
Compress.SetFormatG723 Frequency, BitsPerSample
ElseIf cmbTypeCompress.ListIndex = 6 Then 'G.726
Compress.SetFormatG726 Frequency, BitsPerSample
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatOggVorbis | SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatOggVorbis method

SetFormatOggVorbis method

Sets the format of an Ogg Vorbis audio compression.

Syntax

object.SetFormatOggVorbis(Frequency As FrequencyConstants, nChannels As ChannelsConstants, NominalBitrate As BitrateConstants, MinBitrate As BitrateConstants, MaxBitrate As BitrateConstants, Quality As Integer)

The SetFormatOggVorbis method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an audio file. By default the Frequency is equal to FQ_44_KHZ.
nChannels | ChannelsConstants | Number of channels of an audio file. By default the nChannels is equal to STEREO.
NominalBitrate | BitrateConstants | Bitrate of an audio file. By default the NominalBitrate is equal to BR_128_KBPS.
MinBitrate | BitrateConstants | Minimal bitrate. By default the MinBitrate is equal to BR_NONE.
MaxBitrate | BitrateConstants | Maxilmal bitrate. By default the MaxBitrate is equal to BR_NONE.
Quality | Integer | Varies from 0 (best quality and worse speed) to 1000 (worse quality and best speed). By default the Quality is equal to -1 (not used).

Remarks:

Before applying the SetFormatOggVorbis method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If flag = 1 Then
If Compress.IsFormatOggVorbisAvailable(, , Bitrate, MinBitrate, MaxBitrate) = True Then
Compress.SetFormatOggVorbis , , Bitrate, MinBitrate, MaxBitrate
EndIf
ElseIf flag = 2 Then
If Compress.IsFormatOggVorbisAvailable(, , Bitrate, MinBitrate, MaxBitrate) = True Then
Compress.SetFormatOggVorbis , , , , , Quality
EndIf
EndIf

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatMP3Ex SetFormatPCM | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatPCM method

SetFormatPCM method (AudioCompress2 object)

Sets the format of a PCM audio compression.

Syntax

object.SetFormatPCM(Frequency As FrequencyConstants, nChannels As ChannelsConstants, BitsPerSample As BitsPerSampleConstants)

The SetFormatPCM method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of a PCM audio file. By default the Frequency is equal to FQ_8_KHZ.
nChannels | ChannelsConstants | The number of channels of a PCM audio file. By default the nChannels is equal to MONO.
BitsPerSample | BitsPerSampleConstants | The number of bits per sample of PCM audio file. By default the BitsPerSample is equal to BPS_16_BIT.

Remarks:

Before applying the SetFormatPCM method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If cmbTypeCompress.ListIndex = 0 Then 'PCM
Compress.SetFormatPCM Frequency, Channels, BPS_16_BIT
ElseIf cmbTypeCompress.ListIndex = 1 Then 'MP3
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
Compress.SetFormatMP3Ex LameFormat
ElseIf cmbTypeCompress.ListIndex = 2 Then 'MP2
Compress.SetFormatMP2 Frequency, Bitrate, Channels
ElseIf cmbTypeCompress.ListIndex = 3 Then 'VOX
Compress.SetFormatVOX Frequency
ElseIf cmbTypeCompress.ListIndex = 4 Then 'G.721
Compress.SetFormatG721 Frequency
ElseIf cmbTypeCompress.ListIndex = 5 Then 'G.723
Compress.SetFormatG723 Frequency, BitsPerSample
ElseIf cmbTypeCompress.ListIndex = 6 Then 'G.726
Compress.SetFormatG726 Frequency, BitsPerSample
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatOggVorbis | SetFormatMP3Ex | SetFormatULAW | SetFormatVOX

Applies to: AudioCompress2


SetFormatULAW method

SetFormatULAW method (AudioCompress2 object)

Sets the format of an U-law audio compression.

Syntax

object.SetFormatULAW(Frequency As FrequencyConstants, nChannels As ChannelsConstants)

The SetFormatULAW method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an audio file. By default the Frequency is equal to FQ_8_KHZ.
nChannels | ChannelsConstants | Number of channels of an audio file. By default the nChannels is equal to MONO.

Remarks:

Before applying the SetFormatULAW method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatADPCM Freq, Chann
ElseIf TypeComp = 2 Then
Compress.SetFormatALAW Freq, Chann
ElseIf TypeComp = 3 Then
Compress.SetFormatDSP
ElseIf TypeComp = 4 Then
Compress.SetFormatGSM Freq
ElseIf TypeComp = 5 Then
Compress.SetFormatMP3 Freq
ElseIf TypeComp = 6 Then
Compress.SetFormatULAW Freq, Chann
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatOggVorbis | SetFormatMP3Ex | SetFormatPCM | SetFormatVOX

Applies to: AudioCompress2


SetFormatVOX method

SetFormatVOX method (AudioCompress2 object)

Sets the format of a VOX audio compression.

Syntax

object.SetFormatVOX(Frequency As FrequencyConstants)

The SetFormatVOX method syntax has these parts:

Part | Type | Description
object | AudioCompress2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of a VOX audio file. By default the Frequency is equal to FQ_8_KHZ.

Remarks:

Before applying the SetFormatVOX method the SetFormatArray method must be used.

Example:

' VB sample where Compress is an AudioCompress2 object.
If TypeComp = 1 Then
Compress.SetFormatPCM Freq, Chann, BPS_16_BIT
Compress.InitDecoder WAV
ElseIf TypeComp = 2 Then
Compress.InitDecoder MP3
ElseIf TypeComp = 3 Then
Compress.InitDecoder MP2
ElseIf TypeComp = 4 Then
Compress.SetFormatVOX Freq
Compress.InitDecoder VOX
ElseIf TypeComp = 5 Then
Compress.SetFormatG721 Freq
Compress.InitDecoder G721
ElseIf TypeComp = 6 Then
Compress.SetFormatG723 Freq, BitsPerSample
Compress.InitDecoder G723
ElseIf TypeComp = 7 Then
Compress.SetFormatG726 Freq, BitsPerSample
Compress.InitDecoder G726
End If

See Also:

SetFormatACM | SetFormatACM_cbArray | SetFormatADPCM | SetFormatALAW | SetFormatArray | SetFormatDSP | SetFormatG721 | SetFormatG723 | SetFormatG726 | SetFormatGSM | SetFormatMP3 | SetFormatMP2 | SetFormatOggVorbis | SetFormatMP3Ex | SetFormatPCM | SetFormatULAW

Applies to: AudioCompress2


ACMFormat structure

ACMFormat structure

This is the structure of the SetFormatACM method.

Members

Part | Type | Description
cbSize | Integer | Specifies the size of array of the extra information in the format header. For PCM format cbSize is equal to 0.
nAvgBytesPerSec | Long | Specifies the average data rate. Playback software can estimate the buffer size by using this value. For PCM format nAvgBytesPerSec is equal to (nBlockAlign*nSamplesPerSec).
nBlockAlign | Integer | Specifies the block alignment of the data, in bytes. Playback software must process a multiple of nBlockAlign bytes of data at a time, so that the value of nBlockAlign can be used for buffer alignment. For PCM format nBlockAlign is equal to (nChannels*wBitsPerSample/8).
nChannels | Integer | Specifies the number of channels in the audio array, 1 for mono, 2 for stereo.
nSamplesPerSec | Long | Specifies the frequency of the sample rate of the audio array in samples/second (Hz). Examples are 11,025, 22,050, or 44,100.
wBitsPerSample | Integer | Specifies the number of bits per sample per channel data. Each channel is assumed to have the same sample resolution. Can be 8 or 16.
wFormatTag | Integer | Defines the audio waveform type of the audio array. A complete list of format tags can be found in the Mmreg.h header file included with Microsoft® Visual C++® and other Microsoft products. For example, 1 - PCM, 6 - A-LAW, 7 - U-LAW, 80 - MPEG-2, 85 - MPEG-3.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim ACM As ACMFormat
ACM.wFormatTag = 1 'PCM format
ACM.wBitsPerSample = 8
ACM.nSamplesPerSec = 44,100
ACM.nChannels = 2
ACM.nBlockAlign = (ACM.nChannels*ACM.wBitsPerSample)/8 'Only for PCM format
ACM.nAvgBytesPerSec = ACM.nBlockAlign*ACM.nSamplesPerSec 'Only for PCM format
ACM.cbSize = 0 'for PCM format extra information is not used
Compress.SetFormatACM ACM


AudioCompress2LameEnc

AudioCompress2LameEnc object

The AudioCompress2LameEnc object is intended for changing the parameters of the lame mp3 encoder.


AudioCompress2LameEnc properties

AudioCompress2LameEnc properties

Property | Type | Default | Description
Abrbitrate | Integer |  | Gets or sets maximum ABR/VBR bitrate.
ATHControlMode | Integer |  | Gets or sets ATH (absolute threshold of hearing).
Bitrate | BitrateConstants | BR_128_KBPS | Gets or sets bitrate of an MP3 file.
BitReservoir | Boolean | True | Gets or sets a flag indicating if the bit reservoir is used or not. Each frame will then become independent from the previous ones, but the quality will be lower.
BlockTypeControl | Boolean |  | Gets or sets a flag indicating if the block type control is enabled or not. The block type control allows block types to differ between channels.
Channels | ChannelsConstants | STEREO | Gets or sets the number of channels in the MP3 file. Monaural data uses one channel and stereo data uses two channels.
Emphasis | Integer |  | Gets or sets the type of emphasis of the audio array.
EncoderQuality | Integer |  | Gets or sets encoder quality.
ErrorProtection | Boolean |  | Gets or sets a flag indicating if the error protection is enabled or not.
Frequency | FrequencyConstants | FQ_44_KHZ | Gets or sets the frequency of an MP3 file.
HighPassFrequency | Long |  | Gets or sets the frequency for high pass filtering.
HighPassWidth | Long |  | Gets or sets the width of high pass filtering.
LowPassFrequency | Long |  | Gets or sets the frequency for low pass filtering.
LowPassWidth | Long |  | Gets or sets the width of low pass filtering.
ShortBlocks | Boolean |  | Gets or sets a flag indicating if short blocks are used or not.
StrictISOCompliance | Boolean |  | Gets or sets a flag indicating if ISO MPEG specification is enabled or not.
StrictlyEnforceMinBitrate | Boolean |  | Gets or sets a flag indicating if minimum bitrate is enforced or not.
TypeStereo | Mp3LameTypeStereoConstants |  | Gets or sets the type of stereo realization.
VbrBitrate | BitrateConstants |  | Gets or sets VBR bitrate.
VbrCodingMethod | Mp3LameMethodConstants |  | Gets or sets the type of lame method.
VbrQuality | Integer |  | Gets or sets VBR quality.
WritingVBRHeader | Boolean |  | Gets or sets a flag indicating if VBR header is included in audio file or not.


AbrBitrate property (AudioCompress2LameEnc)

AbrBitrate property (AudioCompress2LameEnc object)

Gets or sets maximum ABR/VBR bitrate.

Property type

An Integer value.

Syntax

object.AbrBitrate [= value]

The AbrBitrate property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Integer | Maximum ABR/VBR bitrate. Varies from 10 to 310.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.VbrCodingMethod = VBR_ABR
LameFormat.AbrBitrate = 128
LameFormat.VbrBitrate = BR_192_KBPS
LameFormat.WritingVBRHeader = True
LameFormat.StrictlyEnforceMinBitrate = False
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


ATHControlMode property (AudioCompress2LameEnc)

ATHControlMode property (AudioCompress2LameEnc object)

Gets or sets ATH (absolute threshold of hearing).

Property type

An Integer value.

Syntax

object.ATHControlMode [= value]

The ATHControlMode property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Integer | Can be one of the following values: 1 - default, 2 - ATH only (ignore psychoacoustics' model, use ATH only), 3 - disable ATH (use psychoacoustics' model only), 4 - ATH only for short block (ignore psychoacoustics' model for short blocks, use ATH only).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


Bitrate property (AudioCompress2LameEnc)

Bitrate property (AudioCompress2LameEnc object)

Gets or sets bitrate of an MP3 file.

Property type

A BitrateConstants value.

Syntax

object.Bitrate [= value]

The Bitrate property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | BitrateConstants | Bitrate of the MP3 file. By default the value is set to BR_128_KBPS.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


BitReservoir property (AudioCompress2LameEnc)

BitReservoir property (AudioCompress2LameEnc object)

Gets or sets a flag indicating if the bit reservoir is used or not. Each frame will then become independent from the previous ones, but the quality will be lower.

Property type

A Boolean value.

Syntax

object.BitReservoir [= value]

The BitReservoir property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Boolean | Can be True (bit reservoir is used) or False (bit reservoir isn't used). By default is True.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


BlockTypeControl property (AudioCompress2LameEnc)

BlockTypeControl property (AudioCompress2LameEnc object)

Gets or sets a flag indicating if the block type control is enabled or not. The block type control allows block types to differ between channels.

Property type

A Boolean value.

Syntax

object.BlockTypeControl [= value]

The BlockTypeControl property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Boolean | Can be True (block type control is enabled) or False (block type control is disabled).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = FQ_24_KHZ
LameFormat.Bitrate = BR_160_KBPS
LameFormat.Channels = 2
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
LameFormat.BlockTypeControl = False
LameFormat.StrictISOCompliance = False
LameFormat.Emphasis = 3
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


Channels property (AudioCompress2LameEnc)

Channels property (AudioCompress2LameEnc object)

Gets or sets the number of channels in the MP3 file. Monaural data uses one channel and stereo data uses two channels.

Property type

A ChannelsConstants value.

Syntax

object.Channels [= value]

The Channels property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | ChannelsConstants | The number of channels of an MP3 file. By default the value is equal to STEREO.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


Emphasis property (AudioCompress2LameEnc)

Emphasis property (AudioCompress2LameEnc object)

Gets or sets the type of emphasis of the audio array.

Property type

An Integer value.

Syntax

object.Emphasis [= value]

The Emphasis property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Integer | Can be one of the following values: 1 - none (default), 2 0/15 microseconds, 3 - citt j.17.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = FQ_24_KHZ
LameFormat.Bitrate = BR_160_KBPS
LameFormat.Channels = 2
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
LameFormat.BlockTypeControl = False
LameFormat.StrictISOCompliance = False
LameFormat.Emphasis = 3
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


EncoderQuality property (AudioCompress2LameEnc)

EncoderQuality property (AudioCompress2LameEnc object)

Gets or sets encoder quality.

Property type

An Integer value.

Syntax

object.EncoderQuality [= value]

The EncoderQuality property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Integer | Varies from 0 (the best quality and the worst speed) to 9 (the worst quality and the best speed).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.EncoderQuality = 7
LameFormat.TypeStereo = 2
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


ErrorProtection property (AudioCompress2LameEnc)

ErrorProtection property (AudioCompress2LameEnc object)

Gets or sets a flag indicating if the error protection is enabled or not.

Property type

An Boolean value.

Syntax

object.ErrorProtection [= value]

The ErrorProtection property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Boolean | Can be True (error protection is enabled) or False (error protection is disabled).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.EncoderQuality = 7
LameFormat.TypeStereo = 2
LameFormat.ErrorProtection = True
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


Frequency property (AudioCompress2LameEnc)

Frequency property (AudioCompress2LameEnc object)

Gets or sets the frequency of an MP3 file.

Property type

A FrequencyConstants value.

Syntax

object.Frequency [= value]

The Frequency property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | FrequencyConstants | Frequency of the MP3 file. By default the value is equal to FQ_44_KHZ.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


HighPassFrequency property (AudioCompress2LameEnc)

HighPassFrequency property (AudioCompress2LameEnc object)

Gets or sets the frequency for high pass filtering.

Property type

A Long value.

Syntax

object.HighPassFrequency [= value]

The HighPassFrequency property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Long | Frequency, in hertz.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = FQ_24_KHZ
LameFormat.Bitrate = BR_160_KBPS
LameFormat.Channels = 2
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
LameFormat.BlockTypeControl = False
LameFormat.StrictISOCompliance = False
LameFormat.Emphasis = 3
LameFormat.HighPassFrequency = 30
LameFormat.HighPassWidth = 5
LameFormat.LowPassFrequency = 15160
LameFormat.LowPassWidth = 760
Compress.SetFormatMP3Ex LameFormat

See Also:

HighPassWidth

Applies to: AudioCompress2LameEnc


HighPassWidth property (AudioCompress2LameEnc)

HighPassWidth property (AudioCompress2LameEnc object)

Gets or sets the width of high pass filtering.

Property type

A Long value.

Syntax

object.HighPassWidth [= value]

The HighPassWidth property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Long | Width of high pass filtering, in hertz.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = FQ_24_KHZ
LameFormat.Bitrate = BR_160_KBPS
LameFormat.Channels = 2
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
LameFormat.BlockTypeControl = False
LameFormat.StrictISOCompliance = False
LameFormat.Emphasis = 3
LameFormat.HighPassFrequency = 30
LameFormat.HighPassWidth = 5
LameFormat.LowPassFrequency = 15160
LameFormat.LowPassWidth = 760
Compress.SetFormatMP3Ex LameFormat

See Also:

HighPassFrequency

Applies to: AudioCompress2LameEnc


LowPassFrequency property (AudioCompress2LameEnc)

LowPassFrequency property (AudioCompress2LameEnc object)

Gets or sets the frequency for low pass filtering.

Property type

A Long value.

Syntax

object.LowPassFrequency [= value]

The LowPassFrequency property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Long | Frequency, in hertz.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = FQ_24_KHZ
LameFormat.Bitrate = BR_160_KBPS
LameFormat.Channels = 2
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
LameFormat.BlockTypeControl = False
LameFormat.StrictISOCompliance = False
LameFormat.Emphasis = 3
LameFormat.HighPassFrequency = 30
LameFormat.HighPassWidth = 5
LameFormat.LowPassFrequency = 15160
LameFormat.LowPassWidth = 760
Compress.SetFormatMP3Ex LameFormat

See Also:

LowPassWidth

Applies to: AudioCompress2LameEnc


LowPassWidth property (AudioCompress2LameEnc)

LowPassWidth property (AudioCompress2LameEnc object)

Gets or sets the width of low pass filtering.

Property type

A Long value.

Syntax

object.LowPassWidth [= value]

The LowPassWidth property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Long | Width of low pass filtering, in hertz.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = FQ_24_KHZ
LameFormat.Bitrate = BR_160_KBPS
LameFormat.Channels = 2
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
LameFormat.BlockTypeControl = False
LameFormat.StrictISOCompliance = False
LameFormat.Emphasis = 3
LameFormat.HighPassFrequency = 30
LameFormat.HighPassWidth = 5
LameFormat.LowPassFrequency = 15160
LameFormat.LowPassWidth = 760
Compress.SetFormatMP3Ex LameFormat

See Also:

LowPassFrequency

Applies to: AudioCompress2LameEnc


ShortBlocks property (AudioCompress2LameEnc)

ShortBlocks property (AudioCompress2LameEnc object)

Gets or sets a flag indicating if short blocks are used or not.

Property type

A Boolean value.

Syntax

object.ShortBlocks [= value]

The ShortBlocks property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Boolean | Can be True (short blocks are used) or False (short blocks aren't used).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


StrictISOCompliance property (AudioCompress2LameEnc)

StrictISOCompliance property (AudioCompress2LameEnc object)

Gets or sets a flag indicating if ISO MPEG specification is enabled or not.

Property type

A Boolean value.

Syntax

object.StrictISOCompliance [= value]

The StrictISOCompliance property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Boolean | Can be True (ISO MPEG specification is enable) or False (ISO MPEG specification is disable).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = FQ_24_KHZ
LameFormat.Bitrate = BR_160_KBPS
LameFormat.Channels = 2
LameFormat.ATHControlMode = 4
LameFormat.ShortBlocks = True
LameFormat.BitReservoir = True
LameFormat.BlockTypeControl = False
LameFormat.StrictISOCompliance = False
LameFormat.Emphasis = 3
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


StrictlyEnforceMinBitrate property (AudioCompress2LameEnc)

StrictlyEnforceMinBitrate property (AudioCompress2LameEnc object)

Gets or sets a flag indicating if minimum bitrate is enforced or not.

Property type

A Boolean value.

Syntax

object.StrictlyEnforceMinBitrate [= value]

The StrictlyEnforceMinBitrate property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Boolean | False if the minimum bitrate is ignored for passages of analog silence, otherwise -True.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.CodingMethod = VBR_ABR
LameFormat.AbrBitrate = 128
LameFormat.VbrBitrate = BR_192_KBPS
LameFormat.WritingVBRHeader = True
LameFormat.StrictlyEnforceMinBitrate = False
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


TypeStereo property (AudioCompress2LameEnc)

TypeStereo property (AudioCompress2LameEnc object)

Gets or sets the type of stereo realization.

Property type

An Mp3LameTypeStereoConstants value.

Syntax

object.TypeStereo [= value]

The TypeStereo property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Mp3LameTypeStereoConstants | Type of stereo.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.EncoderQuality = 7
LameFormat.TypeStereo = 2
Compress.SetFormatMP3Ex LameFormat

See Also:

Applies to: AudioCompress2LameEnc


VbrBitrate property (AudioCompress2LameEnc)

VbrBitrate property (AudioCompress2LameEnc object)

Gets or sets VBR bitrate.

Property type

A BitrateConstants value.

Syntax

object.VbrBitrate [= value]

The VbrBitrate property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | BitrateConstants | Type of bitrate.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.CodingMethod = VBR_ABR
LameFormat.AbrBitrate = 128
LameFormat.VbrBitrate = BR_192_KBPS
LameFormat.WritingVBRHeader = True
LameFormat.StrictlyEnforceMinBitrate = False
Compress.SetFormatMP3Ex LameFormat

See Also:

VbrCodingMethod | VbrQuality | WritingVBRHeader

Applies to: AudioCompress2LameEnc


VbrCodingMethod property (AudioCompress2LameEnc)

VbrCodingMethod property (AudioCompress2LameEnc object)

Gets or sets the type of lame method.

Property type

An Mp3LameMethodConstants value.

Syntax

object.VbrCodingMethod [= value]

The VbrCodingMethod property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Mp3LameMethodConstants | Type of lame method.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.CodingMethod = VBR_ABR
LameFormat.AbrBitrate = 128
LameFormat.VbrBitrate = BR_192_KBPS
LameFormat.WritingVBRHeader = True
LameFormat.StrictlyEnforceMinBitrate = False
Compress.SetFormatMP3Ex LameFormat

See Also:

VbrBitrate | VbrQuality | WritingVBRHeader

Applies to: AudioCompress2LameEnc


VbrQuality property (AudioCompress2LameEnc)

VbrQuality property (AudioCompress2LameEnc object)

Gets or sets VBR quality.

Property type

An Integer value.

Syntax

object.VbrQuality [= value]

The VbrQuality property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Integer | Varies from 0 (best quality and worse speed) to 9 (worse quality and best speed).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.CodingMethod = VBR_NEW
LameFormat.VbrQuality = 7
LameFormat.VbrBitrate = BR_192_KBPS
LameFormat.WritingVBRHeader = True
LameFormat.StrictlyEnforceMinBitrate = False
Compress.SetFormatMP3Ex LameFormat

See Also:

VbrBitrate | VbrCodingMethod | WritingVBRHeader

Applies to: AudioCompress2LameEnc


WritingVBRHeader property (AudioCompress2LameEnc)

WritingVBRHeader property (AudioCompress2LameEnc object)

Gets or sets a flag indicating if VBR header is included in audio file or not.

Property type

A Boolean value.

Syntax

object.WritingVBRHeader [= value]

The WritingVBRHeader property syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
value | Boolean | Can be True (VBR header is included) or False (VBR header isn't included).

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
LameFormat.Frequency = Frequency
LameFormat.Bitrate = Bitrate
LameFormat.Channels = Channels
LameFormat.CodingMethod = VBR_ABR
LameFormat.AbrBitrate = 128
LameFormat.VbrBitrate = BR_192_KBPS
LameFormat.WritingVBRHeader = True
LameFormat.StrictlyEnforceMinBitrate = False
Compress.SetFormatMP3Ex LameFormat

See Also:

VbrBitrate | VbrCodingMethod | VbrQuality

Applies to: AudioCompress2LameEnc


AudioCompress2LameEnc methods

AudioCompress2LameEnc methods

Method | Description
SetParamsFromAltPreset | Sets the parameters of the lame mp3 encoder from the "alternate" preset.
SetParamsFromCommandLine | Sets the parameters of the lame mp3 encoder from the command line.
SetParamsFromPreset | Sets the parameters of the lame mp3 encoder from the preset.


SetParamsFromAltPreset method

SetParamsFromAltPreset method (AudioCompress2LameEnc object)

Sets the parameters of the lame mp3 encoder from the "alternate" preset.

Syntax

object.SetParamsFromAltPreset(Preset As Integer)

The SetParamsFromAltPreset method syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
Preset | Integer | Number of "alternate" preset. Can be one of the following values: 0 - None (abolition of preset parameters), 1 - Fast Standard, 2 - Standard, 3 - Fast Extreme, 4 - Extreme, 5 - Insane. By default is equal to None.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
MP3Lame.SetParamsFromAltPreset 1
Compress.SetFormatMP3Ex LameFormat

See Also:

SetParamsFromCommandLine | SetParamsFromPreset

Applies to: AudioCompress2LameEnc


SetParamsFromCommandLine method

SetParamsFromCommandLine method (AudioCompress2LameEnc object)

Sets the parameters of the lame mp3 encoder from the command line.

Syntax

object.SetParamsFromCommandLine(CommandLine As String)

The SetParamsFromCommandLine method syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
CommandLine | String | Command string.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim Text As String
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
MP3Lame.SetParamsFromCommandLine Text
Compress.SetFormatMP3Ex LameFormat

See Also:

SetParamsFromAltPreset | SetParamsFromPreset

Applies to: AudioCompress2LameEnc


SetParamsFromPreset method

SetParamsFromPreset method (AudioCompress2LameEnc object)

Sets the parameters of the lame mp3 encoder from the preset.

Syntax

object.SetParamsFromPreset(Preset As Integer)

The SetParamsFromPreset method syntax has these parts:

Part | Type | Description
object | AudioCompress2LameEnc | An expression evaluating to an object.
Preset | Integer | Number of preset. Can be one of the following values: 0 - None (abolition of preset parameters), 1 - Phone, 2 - SW, 3 - AM, 4 - FM, 5 - Voice, 6 - Radio, 7 - Tape, 8 - HiFi, 9 - CD, 10 - Studio, 11 - R3Mix. By default is equal to None.

Example:

' VB sample where Compress is an AudioCompress2 object.
Dim LameFormat As AudioCompress2LameEnc
Set LameFormat = New AudioCompress2LameEnc
MP3Lame.SetParamsFromPreset 8
Compress.SetFormatMP3Ex LameFormat

See Also:

SetParamsFromAltPreset | SetParamsFromCommandLine

Applies to: AudioCompress2LameEnc


NCTAudioCompress2 constants

NCTAudioCompress2 constants

Constants | Description
BitrateConstants | These are the constants for the following properties and methods: SetFormatMP2 method, SetFormatMP3 method, SetFormatOggVorbis method, VbrBitrate property (AudioCompress2LameEnc), Bitrate property (AudioCompress2LameEnc), IsFormatOggVorbisAvailable method, IsFormatMpegAvailable method.
BitsPerSampleConstants | These are the constants for the following methods: SetFormatPCM method, SetFormatG723 method, SetFormatG726 method.
ChannelsConstants | These are the constants for the following properties and methods: ArrayChannels property (AudioCompress2), SetFormatMP2 method, SetFormatMP3 method, SetFormatOggVorbis method, SetFormatPCM method, SetFormatADPCM method, SetFormatALAW method, SetFormatULAW method, SetFormatArray method, IsFormatMpegAvailable method, IsFormatOggVorbisAvailable method, Channels property (AudioCompress2LameEnc).
ErrorConstants | These are the constants for the LastErrorNum property (AudioCompress2).
FormatTypeConstants | These are the constants for the following properties and methods: CurrentDecoderFormat property (AudioCompress2), InitDecoder method, CurrentEncoderFormat property (AudioCompress2), InitEncoder method.
FrequencyConstants | These are the constants for the following properties and methods: ArrayFrequency property (AudioCompress2), SetFormatMP2 method, SetFormatMP3 method, SetFormatOggVorbis method, SetFormatPCM method, SetFormatADPCM method, SetFormatALAW method, SetFormatULAW method, SetFormatArray method, SetFormatVOX method, SetFormatG721 method, SetFormatG723 method, SetFormatG726 method, IsFormatMpegAvailable method, IsFormatOggVorbisAvailable method, Frequency property (AudioCompress2LameEnc).
Mp3LameMethodConstants | These are the constants for the VbrCodingMethod property (AudioCompress2LameEnc).
Mp3LameTypeStereoConstants | These are the constants for the TypeStereo property (AudioCompress2LameEnc).


BitrateConstants enumeration

BitrateConstants enumeration

These are the constants for the following properties and methods: SetFormatMP2 method, SetFormatMP3 method, SetFormatOggVorbis method, VbrBitrate property (AudioCompress2LameEnc), Bitrate property (AudioCompress2LameEnc), IsFormatOggVorbisAvailable method, IsFormatMpegAvailable method.

Members

Part | Value | Description
BR_350_KBPS | 350 | 350 kbits per second.
BR_320_KBPS | 320 | 320 kbits per second.
BR_256_KBPS | 256 | 256 kbits per second.
BR_224_KBPS | 224 | 224 kbits per second.
BR_192_KBPS | 192 | 192 kbits per second.
BR_160_KBPS | 160 | 160 kbits per second.
BR_128_KBPS | 128 | 128 kbits per second.
BR_112_KBPS | 112 | 112 kbits per second.
BR_96_KBPS | 96 | 96 kbits per second.
BR_80_KBPS | 80 | 80 kbits per second.
BR_64_KBPS | 64 | 64 kbits per second.
BR_56_KBPS | 56 | 56 kbits per second.
BR_48_KBPS | 48 | 48 kbits per second.
BR_40_KBPS | 40 | 40 kbits per second.
BR_32_KBPS | 32 | 32 kbits per second.
BR_24_KBPS | 24 | 24 kbits per second.
BR_16_KBPS | 16 | 16 kbits per second.
BR_8_KBPS | 8 | 8 kbits per second.
BR_NONE | 0 | None.


BitsPerSampleConstants enumeration

BitsPerSampleConstants enumeration

These are the constants for the following methods: SetFormatPCM method, SetFormatG723 method, SetFormatG726 method.

Members

Constants | Value | Description
BPS_2_BIT | 2 | 2 bits per sample.
BPS_3_BIT | 3 | 3 bits per sample.
BPS_4_BIT | 4 | 4 bits per sample.
BPS_5_BIT | 5 | 5 bits per sample.
BPS_8_BIT | 8 | 8 bits per sample.
BPS_16_BIT | 16 | 16 bits per sample.
BPS_24_BIT | 24 | 24 bits per sample.
BPS_32_BIT | 32 | 32 bits per sample.


ChannelsConstants enumeration

ChannelsConstants enumeration

These are the constants for the following properties and methods: ArrayChannels property (AudioCompress2), SetFormatMP2 method, SetFormatMP3 method, SetFormatOggVorbis method, SetFormatPCM method, SetFormatADPCM method, SetFormatALAW method, SetFormatULAW method, SetFormatArray method, IsFormatMpegAvailable method, IsFormatOggVorbisAvailable method, Channels property (AudioCompress2LameEnc).

Members

Part | Value | Description
MONO | 1 | Mono data uses one channel.
STEREO | 2 | Stereo data uses two channels.


ErrorConstants enumeration

ErrorConstants enumeration

These are the constants for the LastErrorNum property (AudioCompress2).

Members

Part | Value | Description
NOERRORS | 0 | No errors.
BUSY | -10 | It is impossible to execute the current method because the application is busy by another one.
MEMORY | -11 | Memory error.
FORMATFILE | -12 | Wrong file format. It is an attempt to open a non-audio file as an audio file.
FORMATNOTSUPPORT | -13 | Unsupported audio file format. It is an attempt to open an unsupported audio file format.
OUTDRIVER | -14 | Output audio device error. For example: wrong device, audio device is already opened in your application or is in use by another one and many others… It hardly depends on hardware.
INPDRIVER | -15 | Input audio device error. . For example: wrong device, audio device is already opened in your application or is in use by another one and many others… It hardly depends on hardware.
MIXERDRIVER | -16 | Mixer device driver error.
ACMDRIVER | -17 | ACM driver error.
FILEACCESS | -18 | The specified file is already in use.
INVALIDOPERATION | -19 | Invalid operation. For example, you try to execute READ method before OPEN method.
INVALIDPARAM | -20 | Invalid parameters. You try to execute a method with invalid parameters.
ASPIDRIVER | -21 | Incorrect CD driver operation. ASPI driver returns an error.
CONTROLNOTINSTALLED | -22 | Control not installed.
INDEXOUTOFRANGE | -23 | Incorrect address to the array. Index out of the array range.
STREAM | -24 |
UNEXPECTED | -40 | Unexpected error.

Send Feedback on the NCTAudioCompress2 documentation.
NCTAudioCompress2 was developed by NCT company http://www.nctsoft.com


FormatTypeConstants enumeration

FormatTypeConstants enumeration

These are the constants for the following properties and methods: CurrentDecoderFormat property (AudioCompress2), InitDecoder method, CurrentEncoderFormat property (AudioCompress2), InitEncoder method.

Members

Part | Value | Description
DEFAULT | 0 | Default.
WAV | 1 | WAV audio format.
MP3 | 2 | MP3 audio format.
VOX | 3 | VOX audio format.
RAW | 4 | RAW audio format.
G726 | 5 | G726 audio format.
OGG | 6 | OGG audio format.
G721 | 7 | G721 audio format.
G723 | 8 | G723 audio format.
AVI | 9 | AVI audio format.
MPC | 10 | MPC audio format.
MP2 | 12 | MP2 audio format.
WMA | 11 | WMA audio format.
G729 | 12 | G729 audio format.


FrequencyConstants enumeration

FrequencyConstants enumeration

These are the constants for the following properties and methods: ArrayFrequency property (AudioCompress2), SetFormatMP2 method, SetFormatMP3 method, SetFormatOggVorbis method, SetFormatPCM method, SetFormatADPCM method, SetFormatALAW method, SetFormatULAW method, SetFormatArray method, SetFormatVOX method, SetFormatG721 method, SetFormatG723 method, SetFormatG726 method, IsFormatMpegAvailable method, IsFormatOggVorbisAvailable method, Frequency property (AudioCompress2LameEnc).

Members

Part | Value |
FQ_96_KHZ | 96000 | 96000 hertz.
FQ_88_KHZ | 88200 | 88200 hertz.
FQ_48_KHZ | 48000 | 48000 hertz.
FQ_44_KHZ | 44100 | 44100 hertz.
FQ_32_KHZ | 32000 | 32000 hertz.
FQ_24_KHZ | 24000 | 24000 hertz.
FQ_22_KHZ | 22050 | 22050 hertz.
FQ_16_KHZ | 16000 | 16000 hertz.
FQ_12_KHZ | 12000 | 12000 hertz.
FQ_11_KHZ | 11025 | 11025 hertz.
FQ_8_KHZ | 8000 | 8000 hertz.
FQ_6_KHZ | 6000 | 6000 hertz.


Mp3LameMethodConstants enumeration

Mp3LameMethodConstants enumeration

These are the constants for the VbrCodingMethod property (AudioCompress2LameEnc).

Members

Part | Value
VBR_NONE | -1
VBR_DEFAULT | 0
VBR_OLD | 1
VBR_NEW | 2
VBR_MTRH | 3
VBR_ABR | 4


Mp3LameTypeStereoConstants enumeration

Mp3LameTypeStereoConstants enumeration

These are the constants for the TypeStereo property (AudioCompress2LameEnc).

Members

Part | Value | Description
SIMPLY | 1 | Does not use potentially existing correlations between the two input channels.
JOINTSTEREO | 2 | Uses the correlation between both channels.
FORCEDJOINTSTEREO | 3 | Forces MS joint stereo on all frames.
DUALCHANNEL | 4 | The two channels will be totally independently encoded.


NCTAudioCompress2Lib

NCTAudioStudio2 ActiveX DLLs

Version 2.2

NCTAudioCompress2 ActiveX DLL is a tool for compressing and decompressing audio data in memory for further transmitting via the Internet or Intranet. It can be used with other NCTAudioStudio2 controls together to record, compress, decompress and play. You can get audio data from any sources. For example it may be microphone, Internet or an audio file opened by NCTAudioFile2 ActiveX DLL. You can use NCTAudioCompress2 to create your own, unique audio formats based on well-known compression algorithms.

NCTAudioCompress2 consists of the following objects:

  • AudioCompress2 - the main object for compression and decompression.

  • AudioCompress2LameEnc - a complementary object for changing parameters of lame mp3 encoder.

The following audio formats are supported:

  • ACM

  • WAV PCM;

  • Compressed WAV (GSM, ADPCM, DSP, ALAW, ULAW, and others);

  • MP2;

  • MP3 (including files with VBR (variable bitrate));

  • WMA;

  • VOX;

  • RAW (PCM);

  • G.721, G.723, G.726;

  • Mobile Voice;

  • Ogg Vorbis.

NCTAudioCompress2 is a part of the NCTAudioStudio2 package.